package behavioral.iterator.java;

import behavioral.iterator.MenuItem;

import java.util.Iterator;

public class LunchMenu {
    MenuItem[] ls;
    int index = 0;
    final int MAX_LENGTH = 10;

    public LunchMenu() {
        ls = new MenuItem[MAX_LENGTH];
    }

    public void addItem(String name, String description, double price) {
        ls[index] = new MenuItem(name, description, price);
        index ++;
    }

    public Iterator<MenuItem> createIterator() {
        return new LunchMenuIterator(ls);
    }
}
